
void kb_input (void)
{
#if (3 != __BUILD_TYPE__) 
   kb_temp=kb_read();
    if (rs_string[0]=='t') {
        kb_temp=8;
        rs_string[0]='d';
    }
    switch (kb_temp) {
        case 0:
            key_hit=0;
            break;
        case 1:
            if (!key_hit) {
                if (!deb_inj) {
                    deb_inj=1;
                    buzz = 0;
                    //flow_tst_couter=TST_CNT/deb_time;
                    flow_tst_couter = START_PULSE_CNT;
                } else {
                    deb_inj=0;
                    flow_tst_couter=0;
                }
                key_hit=1;
            }
            break;
        case 2:
            if (deb_time <MAX_TMR) {
                deb_time++;
            }
            // 	max_dot=0;
            break;
        /* swap display mode */    
        case 3:
            if (!key_hit) {
                buzz = 0;
                if (display_mode< MAX_DISPLAY) {
                    display_mode++;
                } else {
                    display_mode= NORMAL;
                }
                key_hit=1;
            }
            break;
        /* enable display time swap */    
        case 6:
            if (!key_hit) {
                buzz = 0;
                freeze_dispaly= !freeze_dispaly;
                key_hit=1;
            }
            break;    
        case 4:
            if (deb_time > 1) {
                deb_time--;
            }
            break;
        case 8:
            if (!key_hit) {
                flow_tst_couter=0;
                deb_inj=~deb_inj;
                key_hit=1;
            }
            break;
        case 12:
            RST=1;
            break;
        default:
            break;
    }
#else
    kb_temp=kb_read();

    switch (kb_temp) {
        case 0:
            key_hit=0;
        default:
            out.kb_button = kb_temp;        
            break;
        /* swap display mode */    
        case 3:
            if (!key_hit) {
                buzz = 0;
                if (display_mode < MAX_DISPLAY) {
                    display_mode++;
                } else {
                    display_mode= NORMAL;
                }
                key_hit=1;
            }
            break;
        /* enable display time swap */    
        case 6:
            if (!key_hit) {
                buzz = 0;
                freeze_dispaly= !freeze_dispaly;
                key_hit=1;
            }
            break;    
        case 12:
            RST=1;
            break;
    }
#endif
}

